package com.twu.biblioteca;

import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: apple
 * Date: 28/09/13
 * Time: 3:31 PM
 * To change this template use File | Settings | File Templates.
 */
public class UsersRepository {

    ArrayList<User> users;

    UsersRepository(){
        users=new ArrayList<User>();
        addUsers();
    }

    public void addUsers(){
        users.add(new User("Rohan Poddar","rohan.poddar@gmail.com", "9538591855", "111-1111", "rohan123" ));
    }

    public User checkUserDetails(String username, String password){

        for(User user:users )
            if(username.equals(user.username) && password.equals(user.password))
                return user;
        return null;
    }
}
